﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Schedule.UI.ViewModel;

namespace Schedule.UI.View
{
    public partial class GiangVien : Window
    {
        TeacherViewModel ViewModel = new TeacherViewModel();
        public GiangVien()
        {
            InitializeComponent();
            this.Loaded += (s, e) => { this.DataContext = ViewModel; };
        }
        private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.ViewModel.CurrentGiangvien == null)
            {
                this.ViewModel.CurrentGioitinh = new ScheduleService.GIOITINH();
                this.ViewModel.CurrentloaiCB = new ScheduleService.LOAICB();
                this.ViewModel.CurrentGiangvien = new ScheduleService.GIANGVIEN();
            }
        }

        private void Btn_teach_subject_Click(object sender, RoutedEventArgs e)
        {
            MonhocgiangDay.gv = this.ViewModel.CurrentGiangvien;
            MonhocgiangDay monhocGiangday = new MonhocgiangDay();
            
            monhocGiangday.ShowDialog();
        }

        private void Btn_teacher_time_Click(object sender, RoutedEventArgs e)
        {
            ThoiGianGiangDay thoigianGiangday = new ThoiGianGiangDay();
            thoigianGiangday.gv = new ScheduleService.GIANGVIEN();
            thoigianGiangday.ShowDialog();
        }

    }
}
